# Maintainer: Leonidas Spyropoulos <artafinde@archlinux.org>

pkgname=keycloak-archlinux-theme
pkgver=1.0.4
pkgrel=1
_java=17
pkgdesc="Keycloak Arch Linux theme"
arch=('any')
url="https://gitlab.archlinux.org/archlinux/keycloak-archlinux-theme"
license=('Apache')
groups=()
depends=('keycloak>=17')
makedepends=('gradle' 'git' "java-environment=${_java}")
source=("git+$url.git?signed#tag=v$pkgver")
sha256sums=('SKIP')
validpgpkeys=(
  B4B759625D4633430B74877059E43E106B247368 # artafinde@archlinux.org retreived from https://gitlab.archlinux.org/artafinde.gpg
  )

build() {
  cd "${pkgname}"
  export PATH="/usr/lib/jvm/java-${_java}-openjdk/bin:$PATH"
  export JAVA_HOME="/usr/lib/jvm/java-${_java}-openjdk"
  gradle -Dorg.gradle.daemon=false build
}

package() {
  cd "${pkgname}"
  install -vdm 755 "${pkgdir}"/usr/share/java/keycloak/providers/
  install -vDm 644 "${srcdir}/${pkgname}"/lib/build/libs/keycloak-archlinux-theme.jar \
    "${pkgdir}"/usr/share/java/keycloak/providers/keycloak-archlinux-theme.jar
}

# vim:set ts=2 sw=2 et:
